{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = reversed('12345')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b = list(a)\n",
    "list(\"54321\")==b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "54321"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "int(\"54321\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "int(\"001\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.07130170410027858\n",
      "0.0549041018925891\n",
      "0.052727723078987765\n",
      "0.053887652939465625\n",
      "0.05489541752194782\n",
      "0.06090386930281966\n",
      "0.05260727463337389\n",
      "0.05312456106184982\n",
      "0.05295011848511422\n",
      "0.05452312232591794\n",
      "0.05862025738997545\n",
      "0.05282664938840753\n",
      "0.052905563887634344\n",
      "0.052864029940792534\n",
      "0.05405680937747093\n",
      "0.06108624108719596\n",
      "0.05284213022332551\n",
      "0.05723189082164026\n",
      "0.05596737093128468\n",
      "0.05890533129741016\n",
      "0.05391710428330043\n",
      "0.054749293545228284\n",
      "0.061004683519058744\n",
      "0.06240966366567591\n",
      "0.05339226622800197\n",
      "0.05481159446571837\n",
      "0.05321253751253607\n",
      "0.059971998568016716\n",
      "0.053673564322707534\n",
      "0.05373359975465064\n",
      "0.053817422811334836\n",
      "0.05288857272716996\n",
      "0.06088310232871663\n",
      "0.05275075554027353\n",
      "0.05304262591198494\n",
      "0.052775675908378616\n",
      "0.05384838448071605\n",
      "0.060109438174094976\n",
      "0.05514990734127423\n",
      "0.05438719304493134\n",
      "0.05454426688083913\n",
      "0.05357879140728983\n",
      "0.05967408689502918\n",
      "0.05265522746276474\n",
      "0.053683759018895216\n",
      "0.053852160293445195\n",
      "0.05424408971930461\n",
      "0.059100918428612204\n",
      "0.05247587632857176\n",
      "0.052581221520995314\n",
      "0.053868773872636666\n",
      "0.056028539107501274\n",
      "0.058448835463423165\n",
      "0.05281872018076683\n",
      "0.052842507804598426\n",
      "0.05326577648111197\n",
      "0.05358974126602334\n",
      "0.05914660577036557\n",
      "0.0528417526420526\n",
      "0.05278020688410834\n",
      "0.05222478474070158\n",
      "0.052818720180312084\n",
      "0.05978094241299914\n",
      "0.054367936396829464\n",
      "0.05359238433538849\n",
      "0.052518165437959397\n",
      "0.05969862968186135\n",
      "0.05497282169562823\n",
      "0.0538483844802613\n",
      "0.05285685589569766\n",
      "0.053100773437563475\n",
      "0.053737753149562195\n",
      "0.05984399849558031\n",
      "0.05701138332233313\n",
      "0.05845374402088055\n",
      "0.058147147977251734\n",
      "0.062237864158305456\n",
      "0.059084682431148394\n",
      "0.05794476438131824\n",
      "0.05786471713872743\n",
      "0.06806620964243848\n",
      "0.05894686524425197\n",
      "0.05799724818689356\n",
      "0.05904277090348842\n",
      "0.06092539143855902\n",
      "0.06353334571804226\n",
      "0.07911461707954004\n",
      "0.0802598212681005\n",
      "0.07925469975498345\n",
      "0.07885031014529886\n",
      "0.06447465598557756\n",
      "0.06045379235138171\n",
      "0.05421501595674272\n",
      "0.05309548729883318\n",
      "0.0524543541928324\n",
      "0.054720597363939305\n",
      "0.0741195936020631\n",
      "0.07560311066617942\n",
      "0.07636733528761397\n",
      "0.07520665026459028\n",
      "0.054258815391222015\n",
      "0.0539348506058559\n",
      "0.05464206044598541\n",
      "0.07517040245647877\n",
      "0.07753708226255185\n",
      "0.0747463786174194\n",
      "0.05804482343546624\n",
      "0.06219557504891782\n",
      "0.07485512204175393\n",
      "0.07515831985392651\n",
      "0.07153089597068174\n",
      "0.05455597190211847\n",
      "0.05396052613696156\n",
      "0.074946119143533\n",
      "0.07782140100835022\n",
      "0.0735267909058166\n",
      "0.054529918789739895\n",
      "0.05387481517391279\n",
      "0.05622337107661224\n",
      "0.05364864395460245\n",
      "0.05408777104639739\n",
      "0.054824432230816456\n",
      "0.053576903500925255\n",
      "0.0552171168192217\n",
      "0.07304990568036374\n",
      "0.07585986597359806\n",
      "0.07317488510170733\n",
      "0.06740657504997216\n",
      "0.07512622544027181\n",
      "0.07439220732567264\n",
      "0.07269007066815902\n",
      "0.058858133630565135\n",
      "0.06284803559537977\n",
      "0.0737744842617758\n",
      "0.07704358345836226\n",
      "0.0632403426025121\n",
      "0.05439852048539251\n",
      "0.07106835883541862\n",
      "0.07397384720661648\n",
      "0.07304273163481412\n",
      "0.05865197422190249\n",
      "0.05662813826711499\n",
      "0.07707341238392473\n",
      "0.08336542774668487\n",
      "0.07745779018250687\n",
      "0.06672353041585666\n",
      "0.05901369714047178\n",
      "0.05586127057631529\n",
      "0.05541723492615347\n",
      "0.058860021537384455\n",
      "0.05645105262101424\n",
      "0.059422995307613746\n",
      "0.05492902226069418\n",
      "0.053250673227466905\n",
      "0.058551915168209234\n",
      "0.061233120226461324\n",
      "0.0531000182745629\n",
      "0.056037601059415465\n",
      "0.05551502849266399\n",
      "0.05801537209117669\n",
      "0.05419085075118346\n",
      "0.05241282024599059\n",
      "0.05501095741055906\n",
      "0.059102806335431524\n",
      "0.05797685879542769\n",
      "0.0586614137550896\n",
      "0.05643745969337033\n",
      "0.0611406127995906\n",
      "0.05664022087012199\n",
      "0.0561784388974047\n",
      "0.05676444512891976\n",
      "0.058683691053829534\n",
      "0.0632856523625378\n",
      "0.05406851439829552\n",
      "0.06578297531086719\n",
      "0.07757068700175296\n",
      "0.0717721704431824\n",
      "0.06241683771077078\n",
      "0.054682461649008474\n",
      "0.054683594393281965\n",
      "0.0733697170708183\n",
      "0.07783876974917803\n",
      "0.076007500275864\n",
      "0.07080291915690395\n",
      "0.05482329948699771\n",
      "0.05687394371625487\n",
      "0.08014503654248983\n",
      "0.07507713986660747\n",
      "0.07430498603707747\n",
      "0.05608517630798815\n",
      "0.05506986009868342\n",
      "0.06040130854580639\n",
      "0.06856235151599321\n",
      "0.07580813733102332\n",
      "0.07398517464662291\n",
      "0.06293487930224728\n",
      "0.05365317493078692\n",
      "0.05325935759810818\n",
      "0.05405983002810899\n",
      "0.05815658751043884\n",
      "0.061777970092407486\n",
      "0.07463688003053903\n",
      "0.07458854961942052\n",
      "0.07382545774180471\n",
      "0.06830635137157515\n",
      "0.05518351208002059\n",
      "0.05431998356789336\n",
      "0.060181933790318\n",
      "0.05271715080152717\n",
      "0.05334846679306793\n",
      "0.06898901842441774\n",
      "0.0757598069199048\n",
      "0.07507600712278872\n",
      "0.060285391075922234\n",
      "0.059643125225647964\n",
      "0.05447441433352651\n",
      "0.052802484182848275\n",
      "0.052605764307827485\n",
      "0.05282136324967723\n",
      "0.06381388864974724\n",
      "0.07299289089860395\n",
      "0.07795355447524344\n",
      "0.07158337977580231\n",
      "0.05932935513646953\n",
      "0.05520692212303402\n",
      "0.052970507877034834\n",
      "0.05309397697374152\n",
      "0.05417876814817646\n",
      "0.06929221623613557\n",
      "0.07255036557398853\n",
      "0.07574092785307585\n",
      "0.07045101335279469\n",
      "0.054796491212073306\n",
      "0.05421690386310729\n",
      "0.054028490777000115\n",
      "0.060248388105264894\n",
      "0.05469983039029103\n",
      "0.06715888169492246\n",
      "0.07387076750228516\n",
      "0.07620950628961509\n",
      "0.06267812399482864\n",
      "0.05415800117498293\n",
      "0.05467604276645943\n",
      "0.05403793031018722\n",
      "0.063546561064868\n",
      "0.07777307059723171\n",
      "0.07569259744241208\n",
      "0.07598899879030796\n",
      "0.06896485321885848\n",
      "0.053168738078056776\n",
      "0.05394126948885969\n",
      "0.0591741692078358\n",
      "0.054016785755720775\n",
      "0.05578235607708848\n",
      "0.06823234542935097\n",
      "0.07414942252717083\n",
      "0.0745054817257369\n",
      "0.0681692893467698\n",
      "0.05414705131624942\n",
      "0.058670098125730874\n",
      "0.053913706051389454\n",
      "0.053721517152098386\n",
      "0.052507215579225885\n",
      "0.052320312818665116\n",
      "0.05340019543609742\n",
      "0.060627102184298565\n",
      "0.05235505030123022\n",
      "0.06688475764531177\n",
      "0.07775268120531109\n",
      "0.07789465178666433\n",
      "0.07222149223161978\n",
      "0.05467944099837041\n",
      "0.06026915507891317\n",
      "0.05281645469221985\n",
      "0.05455030818211526\n",
      "0.052976171597038046\n",
      "0.05461072119578603\n",
      "0.07121486039295633\n",
      "0.07506581242705579\n",
      "0.07455683278703873\n",
      "0.06393358193281529\n",
      "0.06007470069152987\n",
      "0.05297730434131154\n",
      "0.052498153627311694\n",
      "0.054808196233352646\n",
      "0.06962222232277782\n",
      "0.0785848704667842\n",
      "0.07449566461127688\n",
      "0.06042660649518439\n",
      "0.06087517312107593\n",
      "0.05338584734499818\n",
      "0.053691688226535916\n",
      "0.05256460794180384\n",
      "0.05368753483207911\n",
      "0.06061766265065671\n",
      "0.052856855895242916\n",
      "0.05254912710779536\n",
      "0.053584832708565955\n",
      "0.053752856402752514\n",
      "0.06073206979499446\n",
      "0.05254384096861031\n",
      "0.05466924630218273\n",
      "0.052856855895242916\n",
      "0.05530245020054281\n",
      "0.060221202249067574\n",
      "0.05281079097221664\n",
      "0.05251741027541357\n",
      "0.052838731991414534\n",
      "0.054301482082337316\n",
      "0.06051118471441441\n",
      "0.05382648476279428\n",
      "0.07052652961965578\n",
      "0.0751005499096209\n",
      "0.0755294823056829\n",
      "0.07199607617485526\n",
      "0.07243482568583204\n",
      "0.06357261417679183\n",
      "0.05260878495846555\n",
      "0.05260236607591651\n",
      "0.05548368924155511\n",
      "0.06846455795039219\n",
      "0.07874760802224046\n",
      "0.07365365823443426\n",
      "0.06483902197396674\n",
      "0.059679373033759475\n",
      "0.054825187393362285\n",
      "0.05477157084396822\n",
      "0.05331523963559448\n",
      "0.05317780002997097\n",
      "0.05370565873590749\n",
      "0.060236683083530806\n",
      "0.05574384278133948\n",
      "0.06946099509332271\n",
      "0.0756744735385837\n",
      "0.07488834919922738\n",
      "0.06409216609381474\n",
      "0.05318346374997418\n",
      "0.05317780002997097\n",
      "0.06035524362278011\n",
      "0.054288644316784485\n",
      "0.0533356290275151\n",
      "0.054867854084477585\n",
      "0.05376154077339379\n",
      "0.06071507863498482\n",
      "0.05389898037947205\n",
      "0.052415085733628075\n",
      "0.05321480300062831\n",
      "0.05462808993706858\n",
      "0.059489827203833556\n",
      "0.054756467590323155\n",
      "0.05413685662051648\n",
      "0.07329759903541344\n",
      "0.07580851491184148\n",
      "0.07420681489020353\n",
      "0.06063654171748567\n",
      "0.05378608356022596\n",
      "0.05918700697293389\n",
      "0.0551491521787284\n",
      "0.05360975307667104\n",
      "0.05769442795690338\n",
      "0.05775710645821164\n",
      "0.05461600733406158\n",
      "0.05410778285749984\n",
      "0.053022991682610154\n",
      "0.056916610406915424\n",
      "0.0569200086388264\n",
      "0.06600272764762849\n",
      "0.07516813696838653\n",
      "0.0729158643066512\n",
      "0.06795180249764599\n",
      "0.05623545367916449\n",
      "0.054136856620061735\n",
      "0.05831366134589189\n",
      "0.05626868083663794\n",
      "0.05419613688991376\n",
      "0.05544253287598622\n",
      "0.05740520065410237\n",
      "0.056109341513547406\n",
      "0.05482669771890869\n",
      "0.05419500414564027\n",
      "0.054087393465579225\n",
      "0.061020919516522554\n",
      "0.056158427086757\n",
      "0.055768385567716905\n",
      "0.07272820638308986\n",
      "0.0816021229134094\n",
      "0.06893162606183978\n",
      "0.05598700516111421\n",
      "0.061995834522804216\n",
      "0.05408663830257865\n",
      "0.055908845824887976\n",
      "0.053828750250886515\n",
      "0.053708679386545555\n",
      "0.053926543816942285\n",
      "0.05975035832489084\n",
      "0.05389898037947205\n",
      "0.0546632050009066\n",
      "0.05242301494172352\n",
      "0.05379325760577558\n",
      "0.05902842281284393\n",
      "0.05387821340582377\n",
      "0.05339226622800197\n",
      "0.052688832201511104\n",
      "0.0534236054786561\n",
      "0.06065202255240365\n",
      "0.05405152323828588\n",
      "0.05430525789552121\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.05348779430596551\n",
      "0.05448838484335283\n",
      "0.05928215746962451\n",
      "0.05469567699537947\n",
      "0.054230119209933036\n",
      "0.05452840846419349\n",
      "0.06659024420468995\n",
      "0.07674680452919347\n",
      "0.07138212892414231\n",
      "0.0639871984826641\n",
      "0.060864600843615335\n",
      "0.054679818579643324\n",
      "0.05324387676364495\n",
      "0.05331901544877837\n",
      "0.05854700661075185\n",
      "0.054961871836894716\n",
      "0.05305131028262622\n",
      "0.052873091892706725\n",
      "0.05967257656993752\n",
      "0.05611425007055004\n",
      "0.05382384169388388\n",
      "0.05275339860963868\n",
      "0.053818933136426494\n",
      "0.057970062331150984\n",
      "0.0565310998640598\n",
      "0.052534401435423206\n",
      "0.053928431723761605\n",
      "0.05392956446758035\n",
      "0.07049065939281718\n",
      "0.07245332717093333\n",
      "0.07589196038725277\n",
      "0.05646540071165873\n",
      "0.059665024943114986\n",
      "0.05269034252660276\n",
      "0.05273640744962904\n",
      "0.05292482053528147\n",
      "0.058713519978937256\n",
      "0.05427731687677806\n",
      "0.05420180060991697\n",
      "0.053624856330316106\n",
      "0.0765187454030638\n",
      "0.07540525804643039\n",
      "0.06856423942281253\n",
      "0.05562792531145533\n",
      "0.06161032397949384\n",
      "0.05515745896855151\n",
      "0.05331448447304865\n",
      "0.05278738092965796\n",
      "0.05294067895192711\n",
      "0.05414554099115776\n",
      "0.05969485386822271\n",
      "0.05277303283901347\n",
      "0.05318157584315486\n",
      "0.05700571960232992\n",
      "0.06502403682816293\n",
      "0.055572420855241944\n",
      "0.05487125231684331\n",
      "0.05787679974127968\n",
      "0.06289410051840605\n",
      "0.055549010812683264\n",
      "0.052816832273492764\n",
      "0.0546379070515286\n",
      "0.05857759069886015\n",
      "0.052716773220254254\n",
      "0.05351044918597836\n",
      "0.06022611080652496\n",
      "0.06234925065200514\n",
      "0.05705367243126602\n",
      "0.05451783618718764\n",
      "0.066013677506362\n",
      "0.07671508769681168\n",
      "0.07328513885158827\n",
      "0.06744395560235716\n",
      "0.0629926492465529\n",
      "0.05579179561073033\n",
      "0.05478516377206688\n",
      "0.05340283850546257\n",
      "0.05645294052783356\n",
      "0.05896876496126424\n",
      "0.07058467714523431\n",
      "0.07364119805015434\n",
      "0.07750007929234926\n",
      "0.0530973752056525\n",
      "0.05301279698687722\n",
      "0.0549293998419671\n",
      "0.05283571134077647\n",
      "0.05958988625707207\n",
      "0.054615629752788664\n",
      "0.05405794212128967\n",
      "0.05359200675411557\n",
      "0.05340208334246199\n",
      "0.06011434673155236\n",
      "0.05297390610894581\n",
      "0.05286251961524613\n",
      "0.052864029940792534\n",
      "0.05344361728975855\n",
      "0.060032789163415146\n",
      "0.052505327672406565\n",
      "0.052682413318507315\n",
      "0.05379401276832141\n",
      "0.05470247346011092\n",
      "0.0604269840764573\n",
      "0.052044678443962766\n",
      "0.052295014869287115\n",
      "0.05315703305632269\n",
      "0.05803727180864371\n",
      "0.05474362982522507\n",
      "0.0531600537074155\n",
      "0.052838731991414534\n",
      "0.05554372467349822\n",
      "0.059369378757764935\n",
      "0.05276774670028317\n",
      "0.0540586972838355\n",
      "0.05343380017484378\n",
      "0.060231396945255256\n",
      "0.052965221738304535\n",
      "0.053704903572906915\n",
      "0.055458768873450026\n",
      "0.06105188118590377\n",
      "0.055951890096366697\n",
      "0.05492902226069418\n",
      "0.05483726999636929\n",
      "0.05917681227720095\n",
      "0.0582434312177611\n",
      "0.059766971903627564\n",
      "0.0568746988788007\n",
      "0.05628189618300894\n",
      "0.05445893349906328\n",
      "0.06068373938433069\n",
      "0.054965647650533356\n",
      "0.05482669771936344\n",
      "0.052502684603041416\n",
      "0.05395750548586875\n",
      "0.06068827036051516\n",
      "0.05298938694386379\n",
      "0.054978107834358525\n",
      "0.05517935868601853\n",
      "0.06565119942479214\n",
      "0.05464206044598541\n",
      "0.053691310645263\n",
      "0.056256220652358024\n",
      "0.055588656852251006\n",
      "0.06102696081779868\n",
      "0.05311700943457254\n",
      "0.05406209551574648\n",
      "0.05359653773030004\n",
      "0.05843864076769023\n",
      "0.060043361440420995\n",
      "0.05335337535098006\n",
      "0.053154767568230454\n",
      "0.055598473967165774\n",
      "0.06016305472348904\n",
      "0.0528496818496933\n",
      "0.05444685089651102\n",
      "0.05569853302085903\n",
      "0.06258070801050053\n",
      "0.0547802552146095\n",
      "0.054006968641260755\n",
      "0.05416970619626227\n",
      "0.05516387785110055\n",
      "0.059991255216573336\n",
      "0.057333082619152265\n",
      "0.05711484060748262\n",
      "0.05555240904459424\n",
      "0.05546632050027256\n",
      "0.06005393371788159\n",
      "0.055737801480063354\n",
      "0.05673725927317719\n",
      "0.055607913500807626\n",
      "0.054545399624657875\n",
      "0.06176399958349066\n",
      "0.054990945599911356\n",
      "0.05745655171585895\n",
      "0.05627321181236766\n",
      "0.06337891495195436\n",
      "0.05501473322374295\n",
      "0.05442230810967885\n",
      "0.054138744526881055\n",
      "0.05963557359882543\n",
      "0.05638120007415637\n",
      "0.05663266924329946\n",
      "0.05557015536714971\n",
      "0.05374983575211445\n",
      "0.05780430412505666\n",
      "0.05394806595313639\n",
      "0.055118945671893016\n",
      "0.052990519687682536\n",
      "0.0531800655180632\n",
      "0.059176057114200376\n",
      "0.055940185075087356\n",
      "0.053306555264953204\n",
      "0.05461147635787711\n",
      "0.05304602414389592\n",
      "0.05856739600267247\n",
      "0.05716921231987726\n",
      "0.055957176235096995\n",
      "0.056411784162719414\n",
      "0.05636496407669256\n",
      "0.0623749261831108\n",
      "0.054615629752788664\n",
      "0.053695086458446895\n",
      "0.05564529405273788\n",
      "0.054031133846365265\n",
      "0.060562913356989156\n",
      "0.05308038404518811\n",
      "0.05709784944792773\n",
      "0.07654668642180695\n",
      "0.07545321087627599\n",
      "0.06179231818350672\n",
      "0.053992242968888604\n",
      "0.07459421333942373\n",
      "0.0756159484312775\n",
      "0.062007539544083556\n",
      "0.0557030639970435\n",
      "0.07721727087255204\n",
      "0.07550720500694297\n",
      "0.0648820662459002\n",
      "0.05430072691933674\n",
      "0.07403048440664861\n",
      "0.07521080365904709\n",
      "0.06833278206431714\n",
      "0.055266957554977125\n",
      "0.07354869062328362\n",
      "0.0732673925290328\n",
      "0.0683063513711204\n",
      "0.05503474503439065\n",
      "0.07675888713174572\n",
      "0.07421587684211772\n",
      "0.06534007240497886\n",
      "0.055600361873985094\n",
      "0.07310692046166878\n",
      "0.07609434398273152\n",
      "0.07296457229858788\n",
      "0.05639705849034726\n",
      "0.06953688894145671\n",
      "0.07471315145994595\n",
      "0.0714859637914742\n",
      "0.060635031391939265\n",
      "0.0632082481888574\n",
      "0.07610491625973737\n",
      "0.0740716407722175\n",
      "0.06317502103138395\n",
      "0.05637704667924481\n",
      "0.07377826007495969\n",
      "0.0732458703928387\n",
      "0.06877795045829771\n",
      "0.05752602668144391\n",
      "0.07106005204605026\n",
      "0.07487249078303648\n",
      "0.0694273903541216\n",
      "0.05458089227022356\n",
      "0.053401705761643825\n",
      "0.07268214146006358\n",
      "0.07930189742182847\n",
      "0.06841094140099813\n",
      "0.058271749817322416\n",
      "0.06143701414703173\n",
      "0.0575350886333581\n",
      "0.054716066387754836\n",
      "0.05454728753102245\n",
      "0.05562868047400116\n",
      "0.05535870981930202\n",
      "0.060213273040972126\n",
      "0.05507174800550274\n",
      "0.05368904515717077\n",
      "0.05332807740114731\n",
      "0.06066825854941271\n",
      "0.055513895748390496\n",
      "0.061742099866023636\n",
      "0.05352328695107644\n",
      "0.06388411877787803\n",
      "0.06028954447083379\n",
      "0.056653813797765906\n",
      "0.056836185582596954\n",
      "0.05557468634287943\n",
      "0.05673725927272244\n",
      "0.05580803160819414\n",
      "0.07697863946896177\n",
      "0.07522213109950826\n",
      "0.06712678728126775\n",
      "0.05416479763925963\n",
      "0.06637917623856993\n",
      "0.07749403799061838\n",
      "0.07435935774901736\n",
      "0.05637138295969635\n",
      "0.05340925738801161\n",
      "0.055260161091609916\n",
      "0.05835028673527631\n",
      "0.05246152823792727\n",
      "0.05387821340582377\n",
      "0.06886479416516522\n",
      "0.0822662884811507\n",
      "0.07429743441025494\n",
      "0.061908990815936704\n",
      "0.06021062997160698\n",
      "0.056223748657430406\n",
      "0.058869083489298646\n",
      "0.060930677577289316\n",
      "0.05865801552317862\n",
      "0.05771292944200468\n",
      "0.05752149570525944\n",
      "0.056736881691449526\n",
      "0.059454334558267874\n",
      "0.057185070736068155\n",
      "0.05528281597162277\n",
      "0.0569105691056393\n",
      "0.056721400856531545\n",
      "0.05548897538028541\n",
      "0.05463148816897956\n",
      "0.0523452331867702\n",
      "0.05642084611417886\n",
      "0.06292808283842533\n",
      "0.054353965887912636\n",
      "0.05386952903563724\n",
      "0.06326979394634691\n",
      "0.06083250643041538\n",
      "0.05661794357138206\n",
      "0.057466746411591885\n",
      "0.055684562511942204\n",
      "0.06012529658983112\n",
      "0.053899357960744965\n",
      "0.054564278691032086\n",
      "0.05470398378520258\n",
      "0.06236473148692312\n",
      "0.05364373539669032\n",
      "0.05310643715756669\n",
      "0.05522051505113268\n",
      "0.05523939411750689\n",
      "0.05680824456430855\n",
      "0.05250834832304463\n",
      "0.05322726318445348\n",
      "0.05304602414435067\n",
      "0.054124396436236566\n",
      "0.05825777930795084\n",
      "0.05472399559585028\n",
      "0.05862931934143489\n",
      "0.059003502444284095\n",
      "0.0552624265792474\n",
      "0.05398355859824733\n",
      "0.05515632622427802\n",
      "0.05311549910948088\n",
      "0.05362976488777349\n",
      "0.056563571858987416\n",
      "0.053123428318031074\n",
      "0.05493959453815478\n",
      "0.05521409616858364\n",
      "0.055362863214213576\n",
      "0.05715901762368958\n",
      "0.05222025376497186\n",
      "0.053368856184988545\n",
      "0.056133506718651915\n",
      "0.05970882437804903\n",
      "0.055192951613662444\n",
      "0.05486181278320146\n",
      "0.055751394407707267\n",
      "0.0592153255734047\n",
      "0.060047137254059635\n",
      "0.05571854483150673\n",
      "0.05653412051469786\n",
      "0.0591673727435591\n",
      "0.05337112167308078\n",
      "0.057004209276328766\n",
      "0.05754868156145676\n",
      "0.05929575039772317\n",
      "0.053833281227070984\n",
      "0.05314683836013501\n",
      "0.05484406646019124\n",
      "0.05663871054457559\n",
      "0.05678068112638357\n",
      "0.05491391900704912\n",
      "0.05598058627811042\n",
      "0.05296220108766647\n",
      "0.05677312949956104\n",
      "0.05484368887891833\n",
      "0.05352517485789576\n",
      "0.0547164439694825\n",
      "0.05583106406947991\n",
      "0.059341437739021785\n",
      "0.05309133390392162\n",
      "0.05299014210640962\n",
      "0.056387241375432495\n",
      "0.05543875706234758\n",
      "0.06259543368241793\n",
      "0.0552424147685997\n",
      "0.0564193357890872\n",
      "0.053418696921653464\n",
      "0.056296999436654005\n",
      "0.05459750584896028\n",
      "0.05569815543958612\n",
      "0.05501548838628878\n",
      "0.055892987408242334\n",
      "0.05844656997578568\n",
      "0.05327748150239131\n",
      "0.05353310406599121\n",
      "0.05411193625195665\n",
      "0.05468888053201226\n",
      "0.056955501284392085\n",
      "0.054395499834754446\n",
      "0.06281254294981409\n",
      "0.06113683698595196\n",
      "0.059938771410998015\n",
      "0.053933717862037156\n",
      "0.05381100392833105\n",
      "0.052737540193447785\n",
      "0.05389180633392243\n",
      "0.06058028209872646\n",
      "0.056343064359225536\n",
      "0.0563940378397092\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.05682523572386344\n",
      "0.05806634557166035\n",
      "0.05646162489847484\n",
      "0.054776479401425604\n",
      "0.05406171793447356\n",
      "0.05632984901285454\n",
      "0.056703654534430825\n",
      "0.055931878285718994\n",
      "0.0526873218759647\n",
      "0.056039488966234785\n",
      "0.06528154729812741\n",
      "0.0625067020687311\n",
      "0.05728664011530782\n",
      "0.0629964250597368\n",
      "0.05910242875415861\n",
      "0.0574724101315951\n",
      "0.05289687951699307\n",
      "0.052742071169632254\n",
      "0.052659003275948635\n",
      "0.054034154497458076\n",
      "0.05675462801400499\n",
      "0.05339377655309363\n",
      "0.05876902443560539\n",
      "0.0571862034798869\n",
      "0.06001164460849395\n",
      "0.05620713507914843\n",
      "0.05508987190933112\n",
      "0.05570193125322476\n",
      "0.06009433492090466\n",
      "0.05414025485242746\n",
      "0.05245284386728599\n",
      "0.05498868011181912\n",
      "0.054467617869704554\n",
      "0.05799838093116705\n",
      "0.05452349990719085\n",
      "0.05246530405111116\n",
      "0.053011286661330814\n",
      "0.05415573568734544\n",
      "0.05675311768936808\n",
      "0.06169414703617804\n",
      "0.05448272112289487\n",
      "0.05793683517367754\n",
      "0.06244175807933061\n",
      "0.059815679895564244\n",
      "0.05829629260415459\n",
      "0.05473154722221807\n",
      "0.05719715333907516\n",
      "0.0597718804606302\n",
      "0.056097636492268066\n",
      "0.055720810320053715\n",
      "0.05712654562921671\n",
      "0.058433354628505185\n",
      "0.05391068540075139\n",
      "0.06285445447838356\n",
      "0.0554606567798146\n",
      "0.05775710645821164\n",
      "0.053519133556619636\n",
      "0.05306981176818226\n",
      "0.052708466430431145\n",
      "0.05357463801283302\n",
      "0.05978547338872886\n",
      "0.05569740027704029\n",
      "0.058365767570194294\n",
      "0.05637780184224539\n",
      "0.059705803727410967\n",
      "0.053556136527276976\n",
      "0.05701553671678994\n",
      "0.05442457359731634\n",
      "0.053601068706029764\n",
      "0.05769291763135698\n",
      "0.05583937085884827\n",
      "0.05524203718732679\n",
      "0.058631207248254213\n",
      "0.056183725036135\n",
      "0.05274735730836255\n",
      "0.05478893958570552\n",
      "0.05689622101499481\n",
      "0.0631202717377164\n",
      "0.05793419210431239\n",
      "0.05596510544319244\n",
      "0.05575932361625746\n",
      "0.05995085401355027\n",
      "0.054104384625588864\n",
      "0.052616714166560996\n",
      "0.054978862996904354\n",
      "0.055106107906340185\n",
      "0.056565459765806736\n",
      "0.056930580916287\n",
      "0.052760195073460636\n",
      "0.05749997356952008\n",
      "0.05271186466279687\n",
      "0.06309799443897646\n",
      "0.054236160511209164\n",
      "0.05680635665748923\n",
      "0.056363831332873815\n",
      "0.06236133325501214\n",
      "0.056338533383495815\n",
      "0.05495922876752957\n",
      "0.0556724799089352\n",
      "0.05650542433340888\n",
      "0.0612591733388399\n",
      "0.055871465272502974\n",
      "0.057064999871727196\n",
      "0.05696078742312238\n",
      "0.05693246882310632\n",
      "0.061096813364656555\n",
      "0.05410098639322314\n",
      "0.05593791958744987\n",
      "0.05495280988452578\n",
      "0.057308917414047755\n",
      "0.05677010884937772\n",
      "0.05259103863591008\n",
      "0.057695560700722126\n",
      "0.06242136868695525\n",
      "0.057883973786374554\n",
      "0.05336621311607814\n",
      "0.056738014435723017\n",
      "0.06004109595232876\n",
      "0.05527677466989189\n",
      "0.05528659178480666\n",
      "0.05793834549922394\n",
      "0.054576738875312\n",
      "0.054202933353735716\n",
      "0.052407156525987375\n",
      "0.05675727108382489\n",
      "0.05690754845500123\n",
      "0.05900765583919565\n",
      "0.055580727644610306\n",
      "0.05822681763856963\n",
      "0.055476515196005494\n",
      "0.05374152896274609\n",
      "0.05428562366614642\n",
      "0.056304173481748876\n",
      "0.060512317458233156\n",
      "0.05446837303225038\n",
      "0.05350856127915904\n",
      "0.05394844353395456\n",
      "0.058273637724141736\n",
      "0.05295691494893617\n",
      "0.05681843926004149\n",
      "0.05568191944212231\n",
      "0.059653319921835646\n",
      "0.05673574894763078\n",
      "0.054573340643401025\n",
      "0.05743163134729912\n",
      "0.05839786198339425\n",
      "0.05333827209733499\n",
      "0.05237657243742433\n",
      "0.05367318674097987\n",
      "0.05613954801992804\n",
      "0.05904730187921814\n",
      "0.05577367170690195\n",
      "0.054413246157309914\n",
      "0.05305433093371903\n",
      "0.059206641202308674\n",
      "0.05317628970442456\n",
      "0.05270997675597755\n",
      "0.05538589567549934\n",
      "0.058697283981928194\n",
      "0.058750522950049344\n",
      "0.05538098711804196\n",
      "0.05696494081803394\n",
      "0.05738632158772816\n",
      "0.05976810464744631\n",
      "0.05411382415923072\n",
      "0.05273149889217166\n",
      "0.05651901726150754\n",
      "0.05956685379624105\n",
      "0.05627887553282562\n",
      "0.05408059700130252\n",
      "0.056110096676093235\n",
      "0.05700420927678351\n",
      "0.05783413305061913\n",
      "0.05509402530424268\n",
      "0.05507288074886674\n",
      "0.05580387821328259\n",
      "0.057866605045092\n",
      "0.05452689813910183\n",
      "0.054380018999836466\n",
      "0.055354556424845214\n",
      "0.05751130100907176\n",
      "0.055340963496746554\n",
      "0.054393234346207464\n",
      "0.05385669127008441\n",
      "0.060154370352847764\n"
     ]
    }
   ],
   "source": [
    "st = time.clock()\n",
    "def Lycheck(n):\n",
    "    for i in range(0,50):\n",
    "        n = n+int(str(n)[::-1])\n",
    "        if str(n)==str(n)[::-1]: return False\n",
    "    return True\n",
    "len([n for n in range(10000) if Lycheck(n)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "249\n",
      "10 loops, best of 3: 65.6 ms per loop\n"
     ]
    }
   ],
   "source": [
    "%%timeit\n",
    "def is_emphasise(x):\n",
    "    '''判断是否是回文数'''\n",
    "    return True if str(x)==str(x)[::-1] else False\n",
    "\n",
    "result = 0 #记录找到的总数\n",
    "for i in range(1,10001):\n",
    "    st_num = i\n",
    "    n = 0\n",
    "    while n<50:\n",
    "        is_break = False\n",
    "        for_reverse = st_num\n",
    "        reverse_value = int(str(for_reverse)[::-1])\n",
    "        add_res = st_num + reverse_value\n",
    "        if is_emphasise(add_res):\n",
    "            is_break = True\n",
    "            break\n",
    "        else:\n",
    "            st_num = add_res\n",
    "            n += 1\n",
    "    if n==50 and not is_break:\n",
    "        result += 1\n",
    "print(result)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
